package com.xiaol.business.controller;

import com.xiaol.framework.result.ResultUtil;
import com.xiaol.framework.result.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 *  1.添加依赖：
 *      <dependency>
 *          <groupId>org.springframework.boot</groupId>
 *          <artifactId>spring-boot-starter-aop</artifactId>
 *      </dependency>
 *  2.建立处理AOP的类
 *      com.xiaol.framework.aspect.HttpAspect
 *  3.AOP的类需要添加@Aspect、@Component
 *
 *
 */
@RestController
@RequestMapping(value = "/aop")
public class AopController {

    @RequestMapping(value = "/content", method = RequestMethod.GET)
    public Result<String> aopContent(){
        return ResultUtil.success("成功访问了被AOP拦截的方法");
    }
}
